//
//  CommonBillCell.swift
//  KaMengApplication
//
//  Created by DUONIU_MAC on 2018/11/22.
//  Copyright © 2018年 DUONIU_MAC. All rights reserved.
//

import UIKit

class CommonBillCell: UICollectionViewCell {
    
    let imageView = UIImageView()
    let titleLabel = UILabel()
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        self.contentView.addSubview(imageView)
        
        titleLabel.textColor = UIColor.white
        titleLabel.textAlignment = .center
        titleLabel.font = UIFont.systemFont(ofSize: RATIO(maxNum: 16))
        titleLabel.numberOfLines = 2
        self.contentView.addSubview(titleLabel)
        
        imageView.snp.makeConstraints { (make) in
            make.top.equalToSuperview().offset(RATIO_H(maxNum: 30))
            make.centerX.equalToSuperview()
            make.width.height.equalTo(RATIO_H(maxNum: 40))
        }
        
        titleLabel.snp.makeConstraints { (make) in
            make.top.equalTo(imageView.snp.bottom).offset(RATIO_H(maxNum: 20))
            make.centerX.equalTo(imageView)
            make.width.equalTo(RATIO(maxNum: 60))
            make.height.equalTo(RATIO_H(maxNum: 40))
        }
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
}
